package com.cdn.allmobilestore.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.TextUtils;

import com.cdn.allmobilestore.ui.DetailFragment;
import com.cdn.allmobilestore.ui.DeveloperFragment;
import com.cdn.allmobilestore.ui.ListAppFragment;
import com.cdn.allmobilestore.ulti.Constant;
import com.cdn.allmobilestore.ulti.Log;

public class DeveloperActivity extends BaseActivity {
	
	
	String mAppAgency = "";
	String mAppAgencyId = "";
	

	@Override
	protected Fragment newFragmentByTag(String tag)
	  {	 
		Log.v("FRAGMENT_TAG_DETAIL");
		Fragment mDeveloperFragment = null;
	    if (TextUtils.equals(tag, Constant.FRAGMENT_TAG_DETAIL))
	    {
	       mDeveloperFragment = new ListAppFragment();
	       ((ListAppFragment)mDeveloperFragment).setListAppType(Constant.LISTAPP_TYPE_DEVELOPER);	      
	      ((ListAppFragment)mDeveloperFragment).setAgencyId(this.mAppAgencyId);  
	    }
		return mDeveloperFragment;
	    
	  }
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);	
		if(null == savedInstanceState)
		{
			Intent intent = getIntent();		
			this.mAppAgency = intent.getStringExtra(Constant.INTENT_EXTRA_APP_AGENCY);
			this.mAppAgencyId = intent.getStringExtra(Constant.INTENT_EXTRA_APP_AGENCY_ID);
			
			setBarTitle(this.mAppAgency);
			setHomeButtonEnable(true);
			setSearchButtonEnable(true);
			showFragment(Constant.FRAGMENT_TAG_DETAIL, savedInstanceState, false);
		}
		
	}

	
}
